﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Common
{
    public class Pair<T, U>
    {
        public Pair()
        {
        }

        public override int GetHashCode()
        {
            return First.GetHashCode() ^ Second.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return ((obj != null) && (obj is Pair<T, U>) && (this == (Pair<T, U>)obj));
        }

        public static bool operator ==(Pair<T, U> lhs, Pair<T, U> rhs)
        {
            return (lhs.First.Equals(rhs.First) && lhs.Second.Equals(rhs.Second));
        }

        public static bool operator !=(Pair<T, U> lhs, Pair<T, U> rhs)
        {
            return !(lhs == rhs);
        }

        public T First { get; set; }

        public U Second { get; set; }
    }
}
